package com.chengyu.core.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.chengyu.core.model.UserToken;

public interface UserTokenService extends IService<UserToken> {

    /**
     * 获取UserToken
     * @param token 微信为openid
     * @param type 类型
     * @return UserToken
     */
    UserToken getByOpenidAndType(String token, Integer type);

    void bind(String openId, Integer type, Integer uid);

    UserToken getTokenByUserId(Integer userId, Integer type);

    /**
     * 通过用户id删除
     * @param uid 用户ID
     */
    Boolean deleteByUid(Integer uid);
}
